Chris Pollett > Old Classes >
CS156

( Print View )

Student Corner:
  [Grades Sec1]
 
  [Submit Sec1]
 
  [
Lecture Notes]

Course Info:
  [Texts & Links]
  [Topics]
  [Grading]
  [HW Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]

Practice Exams:
  [Mid1]  [Mid2]  [Final]

                           












HW#3 --- last modified March 02 2019 17:19:40..

Solution set.

Due date: Apr 19

Files to be submitted:
  art_classifier.P

Purpose:To gain hands on experience working with knowledge bases, resolution style reasoning systems, and Prolog. To learn a little about planning algorithms.

Specification:

Do the following written problems out of the book: 10.12, 11.2, 11.13, 11.14. You do not have to have to turn these in.

In the Library of Congress numbering system the letter N is used for fine arts. For this assignment your goal is to write a Prolog program which, when given a document in a text file, outputs the best Library of Congress subclassification. i.e., The next letter in the classification not the number range so you might output one of N - by itself for general art, NA - for architecture, NB - for scupture, NC - for drawing design and illustration, etc. I will typically use a couple of pages from real books when testing your programs (see example at the end of the homeowrk description). The Prolog system on which I will run your programs is XSB. Their site has a Prolog manual. The last time I taught a Scheme course I also taught Prolog and created the following handout. Your programs will be tested by typing goals like the following at the command prompt:

| ?-art_classifier('my_text.txt').

Your program should then open the my_text.txt file, read it, and output a classification followed by yes. My handout gives the predicates used in Prolog to read files (see/get/get0/seen). Your program should have both a knowledge base of rules used to classify art documents as well as make use of a definite clause grammar to parse some fragment of the English language in the supplied text. In particular, your program should be able to figure out the paragraphs, sentences, etc in the text and make a stab at parsing the noun phrases, verb phrases, etc for each sentence. Each major group of rules within your code should be well documented, and your code should follow the implicit coding guidelines of my examples on-line in the handout and in prior homework solutions. Beyond these strictures, it is up to you how you write your classifier. You are allowed to use probabilistic models in your rule systems and any other ideas you can come up with or find later in the book. Your remaining score will be determined by how many documents your program correctly classifies as compared to other students programs. I will try to get a Librarian from our library to also enter the competition. Anyone whose program is more successful than her at classifying art books will receive 3 bonus points.

Point Breakdown

Implicit coding guidelines for Prolog followed 1pt
Program uses a Definite Clause Grammar as described above 3pts
Program correctly reads file that was input2pts
Programs has an ``expert system'' knowledge base that is used in doing the text classification 2pts
Rank of the program as compared to others in the class 7pts
Total15pts

Here is an example page from the book: The Art and Architecture of Japan by Robert Paine and Alexander Soper. It has Library of Congress classification of just N since it is general art. Be aware that since the OCR technology is not perfect there might be unparsable sentences. Besides which, it is very hard given the amount of time you have to get a parser for all of English. So your program should have a mechanism for ignoring things it cannot parse.

PART ONE

PAINTING AND SCULPTURE
ROBERT TREAT PAINE

CHAPTER I

INTRODUCTION

The greatness of the early scholars of oriental art lay in their ability to see the art of Asia as constituting a body of traditions which had many points in common and many correlating influences; but that same breadth of view tended to emphasize points of similarity and dependence and to minimize national differences. The debt of Japan to the culture of China has often been stated in such a manner that the indigenous character of the art of the Island Empire has been depreciated or underestimated. Like so many ancient arts, Japanese painting has remained essentially linear with colour applied in fiat masses. In the wide potentialities of hair brush and Chinese ink it indubitably derived from the art of China. And, as in China, art avoided the rendering of forms in shadow or sculpturesque depth. Even sculpture was conceived primarily in terms of line.

The art of Japan is ordinarily one of concrete presentation dealing with visual facts rather than with abstractions, idealizations, or fanciful renderings, except under strong foreign influence. In the native Shinto religion the deities are regarded as spirits and so they remain, too mysterious to portray. The Shinto point of view is clearly to be recognized in the three imperial regalia . mirror, sword, and jewel . which are strictly symbols and not representations of divine power. A cultural antipathy to plastic or graphic expression has prevented the Shinto shrines from becoming great patrons of the arts. The absence of pictorial elements deriving from native mythology has closed one avenue of research which might have revealed ideas and forms original to Japan. The native religion has been almost completely obscured by the vast iconography of Buddhism which has supplied nearly all the religious art of Japan. The gods of Buddhism were represented anthropomorphically. This method of depiction arose from Buddhism in India or at least beyond the limits of western most China. Unlike western art, that of the Far East rarely depicts abstract ideas such as Virtue or Dawn in glorified human form. What is remarkable is the divergence between Japanese and Chinese standards in art. For any proper understanding of Japanese art it is essential to try to grasp the difference between the two cultures. Museum men in particular are plagued by the recurring question of how to distinguish Japanese art from